package com.andy.blog.admin.dto;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.andy.blog.common.converter.StatusConverter;
import lombok.Data;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by andy on 2023/4/25 18:39
 */
@Data
@ColumnWidth(20)
@ContentRowHeight(25)
@HeadRowHeight(26)
public class DictTypeDTO implements Serializable {

    private static final long serialVersionUID = 1371349589805015047L;

    /**
     * 字典主键
     */
    @ExcelProperty(value = "字典编号", index = 0)
    private Long id;

    /**
     * 字典名称
     */
    @ExcelProperty(value = "字典名称", index = 1)
    private String dictName;

    /**
     * 字典类型
     */
    @ExcelProperty(value = "字典类型", index = 2)
    private String dictType;

    /**
     * 状态（0正常 1停用）
     */
    @ExcelProperty(value = "状态", index = 3, converter = StatusConverter.class)
    private String status;

    /**
     * 创建者
     */
    @ExcelIgnore
    private String createBy;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间", index = 5)
    private Date createTime;

    /**
     * 更新者
     */
    @ExcelIgnore
    private String updateBy;

    /**
     * 更新时间
     */
    @ExcelIgnore
    private Date updateTime;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注", index = 4)
    private String remark;


    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
    }
}
